/* ================================
   绿波跟踪页面样式
   ================================ */

/* 背景渐变效果 */
.bg-dark-gradient {
    background: linear-gradient(135deg, #0f172a, #1e293b, #0f172a);
    background-size: 400% 400%;
    animation: gradientShift 8s ease infinite;
    min-height: 100vh;
    overflow-x: hidden; /* 防止水平滚动 */
    overflow-y: auto; /* 允许垂直滚动 */
}

@keyframes gradientShift {
    0% { background-position: 0% 50%; }
    50% { background-position: 100% 50%; }
    100% { background-position: 0% 50%; }
}

/* 主容器 */
.tracking-container {
    padding: var(--space-xl);
    max-width: 1400px;
    margin: 0 auto;
    color: white;
    animation: fadeInUp 0.8s ease-out;
    margin-top: 80px; /* 给顶部导航留出空间 */
    min-height: calc(100vh - 80px); /* 确保页面可以滚动 */
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* ================================
   页面标题区域
   ================================ */

.tracking-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: var(--space-2xl);
    padding-bottom: var(--space-xl);
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.tracking-title {
    flex: 1;
}

.tracking-title i {
    font-size: 3rem;
    color: var(--accent-cyan);
    margin-right: var(--space-md);
    vertical-align: middle;
}

.tracking-title h1 {
    display: inline-block;
    font-size: var(--font-3xl);
    font-weight: 700;
    color: var(--primary-green);
    margin: 0;
    vertical-align: middle;
}

.tracking-title .subtitle {
    display: block;
    font-size: var(--font-lg);
    color: rgba(255, 255, 255, 0.7);
    margin-top: var(--space-sm);
    margin-left: 4.2rem;
}

/* 统计卡片区域 */
.tracking-stats {
    display: flex;
    gap: var(--space-lg);
}

.stat-card {
    background: rgba(255, 255, 255, 0.05);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: var(--radius-lg);
    padding: var(--space-lg);
    display: flex;
    align-items: center;
    gap: var(--space-md);
    min-width: 160px;
    transition: all var(--duration-normal) ease;
}

.stat-card:hover {
    background: rgba(255, 255, 255, 0.08);
    border-color: var(--primary-green);
    transform: translateY(-2px);
    box-shadow: var(--shadow-neon);
}

.stat-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 48px;
    height: 48px;
    border-radius: var(--radius-md);
    background: rgba(76, 175, 80, 0.2);
    color: var(--primary-green);
    font-size: var(--font-xl);
}

.stat-icon.success {
    background: rgba(76, 175, 80, 0.2);
    color: var(--text-success);
}

.stat-icon.warning {
    background: rgba(255, 152, 0, 0.2);
    color: var(--text-warning);
}

.stat-content {
    flex: 1;
}

.stat-number {
    font-size: var(--font-xl);
    font-weight: 700;
    color: white;
    line-height: 1.2;
}

.stat-label {
    font-size: var(--font-sm);
    color: rgba(255, 255, 255, 0.7);
    margin-top: var(--space-xs);
}

/* ================================
   搜索筛选区域
   ================================ */

.filter-section {
    background: rgba(255, 255, 255, 0.03);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: var(--radius-xl);
    padding: var(--space-xl);
    margin-bottom: var(--space-xl);
}

.filter-container {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: var(--space-lg);
    align-items: end;
}

.filter-group {
    display: flex;
    flex-direction: column;
    gap: var(--space-sm);
}

.filter-label {
    display: flex;
    align-items: center;
    gap: var(--space-sm);
    font-size: var(--font-sm);
    font-weight: 500;
    color: rgba(255, 255, 255, 0.9);
}

.filter-label i {
    color: var(--accent-cyan);
    width: 16px;
}

.filter-inputs {
    display: flex;
    align-items: center;
    gap: var(--space-sm);
}

.filter-input,
.filter-select {
    background: rgba(29, 43, 64, 0.6);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: var(--radius-md);
    padding: var(--space-sm) var(--space-md);
    color: white;
    font-size: var(--font-sm);
    transition: all var(--duration-normal) ease;
    width: 100%;
}

.filter-input:focus,
.filter-select:focus {
    outline: none;
    border-color: var(--primary-green);
    box-shadow: 0 0 0 2px rgba(76, 175, 80, 0.2);
}

.filter-input::placeholder {
    color: rgba(255, 255, 255, 0.5);
}

.filter-separator {
    color: rgba(255, 255, 255, 0.7);
    font-size: var(--font-sm);
    white-space: nowrap;
}

.filter-actions {
    display: flex;
    gap: var(--space-sm);
    justify-content: flex-end;
    margin-top: var(--space-md);
}

/* ================================
   表格区域
   ================================ */

.table-section {
    background: rgba(255, 255, 255, 0.03);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: var(--radius-xl);
    padding: var(--space-xl);
}

.section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: var(--space-xl);
}

.section-title {
    display: flex;
    align-items: center;
    gap: var(--space-sm);
    font-size: var(--font-xl);
    font-weight: 600;
    color: white;
}

.section-title i {
    color: var(--accent-cyan);
}

.section-actions {
    display: flex;
    gap: var(--space-sm);
}

/* 表格容器 */
.table-container {
    background: rgba(15, 23, 42, 0.6);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: var(--radius-lg);
    overflow: hidden;
    margin-bottom: var(--space-lg);
}

.tracking-table {
    width: 100%;
    border-collapse: collapse;
    font-size: var(--font-sm);
}

.tracking-table thead th {
    background: rgba(29, 43, 64, 0.8);
    color: rgba(255, 255, 255, 0.9);
    font-weight: 600;
    padding: var(--space-md) var(--space-sm);
    text-align: left;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    font-size: var(--font-xs);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.tracking-table tbody tr {
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
    transition: background-color var(--duration-normal) ease;
}

.tracking-table tbody tr:hover {
    background: rgba(255, 255, 255, 0.02);
}

.tracking-table td {
    padding: var(--space-md) var(--space-sm);
    color: rgba(255, 255, 255, 0.8);
    vertical-align: middle;
}

/* 路口名称样式 */
.intersection-name {
    font-weight: 600;
    color: white !important;
    font-size: var(--font-sm);
    max-width: 200px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* 数值单元格 */
.number-cell {
    font-family: 'Consolas', 'Monaco', 'Lucida Console', monospace;
    font-weight: 500;
    text-align: center;
    color: rgba(255, 255, 255, 0.9);
}

/* 时间单元格 */
.time-cell {
    font-family: 'Consolas', 'Monaco', 'Lucida Console', monospace;
    color: rgba(255, 255, 255, 0.7);
    text-align: center;
    font-size: var(--font-xs);
}

/* 控制器单元格 */
.controller-cell {
    text-align: center;
    font-weight: 500;
    color: var(--accent-cyan);
}

/* 状态徽章 */
.status-badge {
    display: inline-block;
    padding: var(--space-xs) var(--space-sm);
    border-radius: var(--radius-sm);
    font-size: var(--font-xs);
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.status-badge.status-running {
    background: rgba(76, 175, 80, 0.2);
    color: var(--text-success);
    border: 1px solid rgba(76, 175, 80, 0.3);
}

.status-badge.status-adjusting {
    background: rgba(33, 150, 243, 0.2);
    color: #64b5f6;
    border: 1px solid rgba(33, 150, 243, 0.3);
}

.status-badge.status-warning {
    background: rgba(255, 152, 0, 0.2);
    color: var(--text-warning);
    border: 1px solid rgba(255, 152, 0, 0.3);
}

.status-badge.status-offline {
    background: rgba(158, 158, 158, 0.2);
    color: #bdbdbd;
    border: 1px solid rgba(158, 158, 158, 0.3);
}

/* 信号状态 */
.signal-status {
    display: flex;
    align-items: center;
    gap: var(--space-xs);
    justify-content: center;
}

.signal-light {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    border: 1px solid rgba(255, 255, 255, 0.2);
}

.signal-light.green {
    background: #4caf50;
    box-shadow: 0 0 8px rgba(76, 175, 80, 0.6);
    animation: pulse-green 2s ease-in-out infinite;
}

.signal-light.yellow {
    background: #ff9800;
    box-shadow: 0 0 8px rgba(255, 152, 0, 0.6);
    animation: pulse-yellow 1s ease-in-out infinite;
}

.signal-light.red {
    background: #f44336;
    box-shadow: 0 0 8px rgba(244, 67, 54, 0.6);
    animation: pulse-red 2s ease-in-out infinite;
}

.signal-light.offline {
    background: #666;
    border-color: #444;
}

@keyframes pulse-green {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.6; }
}

@keyframes pulse-yellow {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.6; }
}

@keyframes pulse-red {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.6; }
}

.signal-status span {
    font-size: var(--font-xs);
    color: rgba(255, 255, 255, 0.7);
}

/* 效率单元格 */
.efficiency-cell {
    display: flex;
    align-items: center;
    gap: var(--space-sm);
    min-width: 120px;
}

.efficiency-bar {
    flex: 1;
    height: 6px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 3px;
    overflow: hidden;
    position: relative;
}

.efficiency-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--primary-green), var(--accent-cyan));
    border-radius: 3px;
    transition: width var(--duration-normal) ease;
    position: relative;
}

.efficiency-fill.warning {
    background: linear-gradient(90deg, #ff9800, #ffb74d);
}

.efficiency-fill.error {
    background: linear-gradient(90deg, #f44336, #ef5350);
}

.efficiency-fill.offline {
    background: #666;
}

.efficiency-fill::after {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.3), transparent);
    animation: shimmer 2s infinite;
}

@keyframes shimmer {
    0% { left: -100%; }
    100% { left: 100%; }
}

.efficiency-text {
    font-family: 'Consolas', 'Monaco', 'Lucida Console', monospace;
    font-weight: 600;
    font-size: var(--font-xs);
    color: rgba(255, 255, 255, 0.9);
    min-width: 35px;
}

/* 操作按钮 */
.action-cell {
    text-align: center;
    white-space: nowrap;
}

.action-btn {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: var(--radius-sm);
    padding: var(--space-xs) var(--space-sm);
    color: rgba(255, 255, 255, 0.7);
    font-size: var(--font-xs);
    cursor: pointer;
    transition: all var(--duration-normal) ease;
    margin: 0 var(--space-xs);
}

.action-btn:hover:not([disabled]) {
    background: rgba(255, 255, 255, 0.1);
    border-color: var(--primary-green);
    color: var(--primary-green);
    transform: translateY(-1px);
}

.action-btn.view:hover:not([disabled]) {
    border-color: var(--accent-cyan);
    color: var(--accent-cyan);
}

.action-btn.adjust:hover:not([disabled]) {
    border-color: var(--text-warning);
    color: var(--text-warning);
}

.action-btn[disabled] {
    opacity: 0.4;
    cursor: not-allowed;
}

/* ================================
   分页器
   ================================ */

.table-pagination {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: var(--space-lg);
    padding-top: var(--space-lg);
    border-top: 1px solid rgba(255, 255, 255, 0.1);
}

.pagination-info {
    color: rgba(255, 255, 255, 0.7);
    font-size: var(--font-sm);
}

.pagination-controls {
    display: flex;
    gap: var(--space-xs);
}

.pagination-btn {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: var(--radius-sm);
    padding: var(--space-xs) var(--space-sm);
    color: rgba(255, 255, 255, 0.7);
    font-size: var(--font-sm);
    cursor: pointer;
    transition: all var(--duration-normal) ease;
    min-width: 32px;
    text-align: center;
}

.pagination-btn:hover:not(.disabled) {
    background: rgba(255, 255, 255, 0.1);
    border-color: var(--primary-green);
    color: var(--primary-green);
}

.pagination-btn.active {
    background: var(--primary-green);
    border-color: var(--primary-green);
    color: white;
}

.pagination-btn.disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

/* ================================
   响应式设计
   ================================ */

@media (max-width: 1200px) {
    .tracking-container {
        padding: var(--space-lg);
    }

    .tracking-header {
        flex-direction: column;
        gap: var(--space-lg);
    }

    .tracking-stats {
        grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    }

    .filter-container {
        grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    }
}

@media (max-width: 768px) {
    .tracking-container {
        padding: var(--space-md);
    }

    .tracking-stats {
        flex-direction: column;
    }

    .stat-card {
        min-width: unset;
    }

    .filter-container {
        grid-template-columns: 1fr;
    }

    .filter-inputs {
        flex-direction: column;
    }

    .filter-separator {
        display: none;
    }

    .section-header {
        flex-direction: column;
        gap: var(--space-md);
    }

    .table-container {
        overflow-x: auto;
    }

    .tracking-table {
        min-width: 800px;
    }

    .table-pagination {
        flex-direction: column;
        gap: var(--space-md);
    }
} 